x86 tsc: Fix check_tsc_warp() bug and add copyright notice
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 8 Oct 2009 07:51:51 +0000 (08:51 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 8 Oct 2009 07:51:51 +0000 (08:51 +0100)
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/time.c

index 5a56b717c98f7969b3f1b36b21496b1aab774833..7f1a1153d700c0be99e4820c3c03d64965ce3ba7 100644 (file)
@@ -1442,6 +1442,10 @@ struct tm wallclock_time(void)
  * TSC Reliability check
  */
 
+/*
+ * The Linux original version of this function is
+ * Copyright (c) 2006, Red Hat, Inc., Ingo Molnar
+ */
 void check_tsc_warp(unsigned long tsc_khz, unsigned long *max_warp)
 {
 #define rdtsc_barrier() mb()
@@ -1494,7 +1498,7 @@ void check_tsc_warp(unsigned long tsc_khz, unsigned long *max_warp)
         if ( unlikely(prev > now) )
         {
             spin_lock(&sync_lock);
-            if ( *max_warp > prev - now )
+            if ( *max_warp < prev - now )
                 *max_warp = prev - now;
             spin_unlock(&sync_lock);
         }